package com.wdzl.service.impl;

import com.wdzl.dao.IuserDao;
import com.wdzl.pojo.User;
import com.wdzl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class Iuser implements UserService {
    @Autowired
   IuserDao iuserDao;
    @Override
    public User select(User user) {
        String select = iuserDao.select (user);
        if (select==null){
            System.out.println (select);
            return null;
        }
        else if (select.equals (user.getPassword ())){
            System.out.println (select);
            return user;
        }
        else {
            System.out.println (select);
        return null;}
    }

    @Override
    public void insert(User user) {
iuserDao.insert (user);
    }
}
